package com.wardrobe.soa.backend.agreement;


import com.wardrobe.dao.agreement.AgreementDao;
import com.wardrobe.domain.agreement.AgreementBean;
import com.wardrobe.domain.agreement.AgreementShowBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/7.
 */
@Service
public class BackAgreementService {
    @Autowired
    private AgreementDao agreementDao;

    public List<AgreementShowBean> getAgreementList(){
        return agreementDao.selectAgreement();
    }

    public int addAgreement(AgreementBean agreementBean){
        return agreementDao.insertAgreement(agreementBean);
    }

    public int modifyAgreement(AgreementBean fromBean){
        return agreementDao.updateAgreement(fromBean);
    }
    public int removeAgrementById(int id){
        return agreementDao.deleteAgreementById(id);
    }

    public AgreementShowBean getOneAgreement(int type){
        return agreementDao.selectAgreementByType(type);
    }
}
